## Decomposes the De Novo Signatures into COSMIC Signatures and assigns COSMIC signatures into samples
from SigProfilerExtractor import decomposition as decomp
import sys

#################################################################################
work_dir = sys.argv[1]

#################################################################################
# work_dir = "/public/home/xxf2019/20220205_lungSomatic/Analysis_LUAD/SigProfiler/SigProfiler/Extractor"
time_dir = work_dir

#################################################################################
#### DBS
sig_type = "SBS96"

## Path to a tab delimited file that contains the signaure table where the rows are mutation types and colunms are signature IDs.
signatures = time_dir + "/" + sig_type + "/Suggested_Solution/" + sig_type + "_De-Novo_Solution/Signatures/" + sig_type + "_De-Novo_Signatures.txt"
## Path to a tab delimilted file that contains the activity table where the rows are sample IDs and colunms are signature IDs.
activities = time_dir + "/" + sig_type + "/Suggested_Solution/" + sig_type + "_De-Novo_Solution/Activities/" + sig_type + "_De-Novo_Activities_refit.txt"
## Path to a tab delimilted file that contains the activity table where the rows are mutation types and colunms are sample IDs.
samples = time_dir + "/" + sig_type + "/Samples.txt"
## Path to the output folder.
output = time_dir + "/decompose/" + sig_type + "/"

decomp.decompose(signatures, activities, samples, output, genome_build="GRCh37", verbose=False , make_decomposition_plots=False)
